deploy: Use fdatasync() for new kernel/initramfs by default
authorColin Walters <walters@verbum.org>
Wed, 2 May 2018 15:59:21 +0000 (11:59 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 2 May 2018 19:37:52 +0000 (19:37 +0000)
commitd0a18323474e33d55da201395e3506f81021bce7
tree3b25686453605895b8a3b20736d868397200c241
parent9f8e2b886235d0988326cbdcb270678458060b81
deploy: Use fdatasync() for new kernel/initramfs by default

While we do a `syncfs()` plus `FIFREEZE/THAW` for `/boot`, that
only comes during deployment finalization.

The code here today generally assumes that if the file exists
it's been fully written.  So let's do a `fdatasync()` before
we do the `rename()`.

This just came out of looking through the code while working
on deployment staging.  In that scenario there's a much larger
window between when we copy the kernel/initramfs and when we
sync `/boot`.

Closes: #1571
Approved by: jlebon
src/libostree/ostree-sysroot-deploy.c